package com.yeyks.commonReference.pojo.vo;

import cn.hutool.json.JSONUtil;
import com.yeyks.commonReference.utils.ExtInfoToBeanUtil;
import com.yeyks.hotel.dal.domain.HotelInfo;
import com.yeyks.hotel.dal.domain.RoomInfo;
import com.yeyks.order.dal.domain.OrderBill;
import com.yeyks.order.dal.domain.OrderHead;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.util.List;

@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class OrderHeadOrderDetailsVo {

    private OrderHead orderHead;
    private List<OrderBill> orderBills;

    public HotelInfo getHotelInfo(){
        try {
            if(null != orderBills && orderBills.size() > 0){
                return ExtInfoToBeanUtil.obtainHotelInfo(orderBills.get(0));
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }
    public RoomInfo getRoomInfo(){
        try {
            if(null != orderBills && orderBills.size() > 0){
                return ExtInfoToBeanUtil.obtainRoomInfo(orderBills.get(0));
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }

}
